package com.inno.launcher.widget;


import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.text.TextUtils;


/**
 * 对app的所有对话框进行管理
 */
@SuppressLint("InflateParams")
public class DialogMaker {

    private        String                      msg;
    private static LottieLoadingDialog         dialog;
    private static LottieLoadingDialog.Builder dialogBuilder;

    public void setmsg(String msg) {
        this.msg = msg;
    }

    /**
     * 显示统一风格的等待对话框。没有标题(加载提示框)
     *
     * @param msg             对话框内容
     * @param isCanCancelabel 是否可以取消
     */
    public static Dialog showCommenWaitDialog(Context context, String msg, boolean isCanCancelabel) {
        dialogBuilder = new LottieLoadingDialog.Builder(context, isCanCancelabel);
        if (!TextUtils.isEmpty(msg)) {
            dialogBuilder.setMessage(msg);
        }
        dialogBuilder.setMessage(msg);
        dialog = dialogBuilder.create();
        return dialog;
    }


}
